package com.scoresystem.web.ui.view;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;
/**
 * IShowable接口的实现类
 * 
 *
 */
public class ShowListView implements IShowable {
	public void jumpJsp(JSONObject json,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException{
		response.setCharacterEncoding("utf-8");
		response.setHeader("contentType", "text/html; charset=utf-8");
		response.getWriter().print(json.toString());
	}

	@Override
	/**
	 * 将service返回的json字符串返回给前端
	 */
	public void showView(JSONObject json, HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setCharacterEncoding("utf-8");
		response.setHeader("contentType", "text/html; charset=utf-8");
		response.getWriter().print(json.toString());
		
	}
}
